#!/usr/bin/env node
const {EventEmitter} = require('events'),
      e = new EventEmitter();
setInterval(()=>{
  e.emit('hello');
},1000)
setTimeout(()=>{
  e.emit('bye');
  
},5000)
e.on('hello',()=>{
  console.log('hello world');
});
e.on('bye',()=>{
  console.log('goodbye');
  process.exit();
});
